<!DOCTYPE HTML>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>if...else</title>
  <script type="text/JavaScript">
    var ticket =true; //ticket初值为true，表示有票
if(ticket)  
{
document.write("有票，可以看电影。");
}
	  
{
document.write("没票，电影看不成。");
}
</script>
</head>

<body>
</body>

</html>